/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package br.gov.ana.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author lucas.nunes
 */
@Entity
@Table(name = "QLTTB_MED_HIDROMETEOROLOGICA")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "MedHidrometeorologica.findAll", query = "SELECT m FROM MedHidrometeorologica m"),
    @NamedQuery(name = "MedHidrometeorologica.findByMdhId", query = "SELECT m FROM MedHidrometeorologica m WHERE m.mdhId = :mdhId"),
    @NamedQuery(name = "MedHidrometeorologica.findByMdhDt", query = "SELECT m FROM MedHidrometeorologica m WHERE m.mdhDt = :mdhDt"),
    @NamedQuery(name = "MedHidrometeorologica.findByMdhDtRecepcaodado", query = "SELECT m FROM MedHidrometeorologica m WHERE m.mdhDtRecepcaodado = :mdhDtRecepcaodado"),
    @NamedQuery(name = "MedHidrometeorologica.findByMdhVr", query = "SELECT m FROM MedHidrometeorologica m WHERE m.mdhVr = :mdhVr"),
    @NamedQuery(name = "MedHidrometeorologica.findByMdhNuNotafinalmetafiltro", query = "SELECT m FROM MedHidrometeorologica m WHERE m.mdhNuNotafinalmetafiltro = :mdhNuNotafinalmetafiltro")})
public class MedHidrometeorologica implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "MDH_ID")
    private BigDecimal mdhId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MDH_DT")
    @Temporal(TemporalType.TIMESTAMP)
    private Date mdhDt;
    @Basic(optional = false)
    @NotNull
    @Column(name = "MDH_DT_RECEPCAODADO")
    @Temporal(TemporalType.TIMESTAMP)
    private Date mdhDtRecepcaodado;
    @Column(name = "MDH_VR")
    private BigDecimal mdhVr;
    @Column(name = "MDH_NU_NOTAFINALMETAFILTRO")
    private BigDecimal mdhNuNotafinalmetafiltro;
    @JoinColumn(name = "MDH_STR_ID", referencedColumnName = "STR_ID")
    @ManyToOne(optional = false)
    private StatusRegistro mdhStrId;
    @JoinColumn(name = "MDH_STQ_ID", referencedColumnName = "STQ_ID")
    @ManyToOne(optional = false)
    private StatusQualificacao mdhStqId;
    @JoinColumn(name = "MDH_SEM_ID", referencedColumnName = "SEM_ID")
    @ManyToOne(optional = false)
    private StatusExcecaoMedicao mdhSemId;
    @JoinColumn(name = "MDH_STC_ID", referencedColumnName = "STC_ID")
    @ManyToOne(optional = false)
    private StatusConsistencia mdhStcId;
    @JoinColumn(name = "MDH_CVH_ID", referencedColumnName = "CVH_ID")
    @ManyToOne(optional = false)
    private CaracterizacaoVhm mdhCvhId;

    public MedHidrometeorologica() {
    }

    public MedHidrometeorologica(BigDecimal mdhId) {
        this.mdhId = mdhId;
    }

    public MedHidrometeorologica(BigDecimal mdhId, Date mdhDt, Date mdhDtRecepcaodado) {
        this.mdhId = mdhId;
        this.mdhDt = mdhDt;
        this.mdhDtRecepcaodado = mdhDtRecepcaodado;
    }

    public BigDecimal getMdhId() {
        return mdhId;
    }

    public void setMdhId(BigDecimal mdhId) {
        this.mdhId = mdhId;
    }

    public Date getMdhDt() {
        return mdhDt;
    }

    public void setMdhDt(Date mdhDt) {
        this.mdhDt = mdhDt;
    }

    public Date getMdhDtRecepcaodado() {
        return mdhDtRecepcaodado;
    }

    public void setMdhDtRecepcaodado(Date mdhDtRecepcaodado) {
        this.mdhDtRecepcaodado = mdhDtRecepcaodado;
    }

    public BigDecimal getMdhVr() {
        return mdhVr;
    }

    public void setMdhVr(BigDecimal mdhVr) {
        this.mdhVr = mdhVr;
    }

    public BigDecimal getMdhNuNotafinalmetafiltro() {
        return mdhNuNotafinalmetafiltro;
    }

    public void setMdhNuNotafinalmetafiltro(BigDecimal mdhNuNotafinalmetafiltro) {
        this.mdhNuNotafinalmetafiltro = mdhNuNotafinalmetafiltro;
    }

    public StatusRegistro getMdhStrId() {
        return mdhStrId;
    }

    public void setMdhStrId(StatusRegistro mdhStrId) {
        this.mdhStrId = mdhStrId;
    }

    public StatusQualificacao getMdhStqId() {
        return mdhStqId;
    }

    public void setMdhStqId(StatusQualificacao mdhStqId) {
        this.mdhStqId = mdhStqId;
    }

    public StatusExcecaoMedicao getMdhSemId() {
        return mdhSemId;
    }

    public void setMdhSemId(StatusExcecaoMedicao mdhSemId) {
        this.mdhSemId = mdhSemId;
    }

    public StatusConsistencia getMdhStcId() {
        return mdhStcId;
    }

    public void setMdhStcId(StatusConsistencia mdhStcId) {
        this.mdhStcId = mdhStcId;
    }

    public CaracterizacaoVhm getMdhCvhId() {
        return mdhCvhId;
    }

    public void setMdhCvhId(CaracterizacaoVhm mdhCvhId) {
        this.mdhCvhId = mdhCvhId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (mdhId != null ? mdhId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MedHidrometeorologica)) {
            return false;
        }
        MedHidrometeorologica other = (MedHidrometeorologica) object;
        if ((this.mdhId == null && other.mdhId != null) || (this.mdhId != null && !this.mdhId.equals(other.mdhId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "br.gov.ana.service.MedHidrometeorologica[ mdhId=" + mdhId + " ]";
    }
    
}
